﻿CREATE VIEW vw_WindowsEventEntry_Detailed
AS 

Select A.WindowsEventEntryRowId, A.RoleRowId, B.RoleName, A.InstanceNumber, B.DeploymentId, A.WindowsEventLogRowId, E.EventLogName, A.WindowsEventSourceRowId, C.EventSourceName, DateTimeUTC, A.EventLevel, D.EventLevelName, A.Description
From [dbo].[WindowsEventEntry] A
	Left Outer Join [dbo].[Role] B
		On A.RoleRowId = B.RoleRowId
	Left Outer Join [dbo].[WindowsEventSource] C
		On C.WindowsEventSourceRowId = A.WindowsEventSourceRowId
	Left Outer Join [dbo].[EventLevel] D
		On A.EventLevel = D.EventLevelId
	Left Outer Join [dbo].[WindowsEventLog] E
		On E.WindowsEventLogRowId = A.WindowsEventLogRowId